package com.cjm.mybatis.test3;

import com.cjm.mybatis.MybatisUtil.MybatisUtils;
import com.cjm.mybatis.bean.User;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.junit.Test;

/**
 * Created by jiaming.chen1 on 2015/7/7.
 */
public class Test3 {

    @Test
    public void getUser(){
        SqlSessionFactory factory = MybatisUtils.getFactory();

        SqlSession session = factory.openSession(true);

        UserMapper mapper = session.getMapper(UserMapper.class);

        int add = mapper.addUser(new User(14, "555333", 19));
        session.commit();
        System.out.println(add);
    }
}
